package chapter19.h19_3;

public class NightState implements State {
    private static NightState singleton = new NightState();
    private NightState(){

    }
    public static NightState getInstance(){
        return singleton;
    }
    public void doClock(Context context, int hour){
        if(hour >= 12 && hour < 13){
            context.changeState(NoonState.getInstance());
        }else if(hour >= 9 && hour < 17){
            context.changeState(DayState.getInstance());
        }
    }
    //下面是关于使用金库，按警铃的操作，没改变
}
